#include "comm.hpp"

int main()
{
    key_t key = GetKey();
    int msgid = getMessageQueue(key);

    // int fd = open(filename.c_str(), O_WRONLY);
    while (true)
    {
        sleep(1);
        if (sendMessage(msgid, ATYPE, "hello"))
        {
            std::cout << "send success" << std::endl;

            // int code = 1;
            // write(fd, &code, sizeof(int));
        }
        else
        {
            return -1;
        }
    }

    return 0;
}